package com.ap.core.email.template.type;

import com.ap.core.cxf.email.jaxb.managemessage.TemplateNameType;

/**
 * Velocity template enum mapping for template name with template path on classpath
 */
public enum VelocityTemplateMapping {

    WELCOMETOZAPP(TemplateNameType.WELCOMETOZAPP, "/velocity-template/welcometozapp.vm");

    private TemplateNameType templateNameType;
    private String templatePath;

    private VelocityTemplateMapping(TemplateNameType templateNameType, String templatePath){
        this.templateNameType= templateNameType;
        this.templatePath= templatePath;
    }

    public TemplateNameType getTemplateNameType() {
        return templateNameType;
    }

    public String getTemplatePath() {
        return templatePath;
    }

    public static VelocityTemplateMapping getVelocityTemplateMapping(TemplateNameType templateNameType){

        VelocityTemplateMapping velocityTemplateMapping = null;
        switch (templateNameType) {
            case WELCOMETOZAPP:
                velocityTemplateMapping = VelocityTemplateMapping.WELCOMETOZAPP;
                break;

            default:
                // not found
                throw new IllegalArgumentException("Unable to determine");
        }
        return velocityTemplateMapping;
    }
}
